1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to encrypting data, and more particularly, to encrypting data in a digital transmission content protection (DTCP) standard.
2. Description of the Related Art
The DTCP standard was developed as a protocol for audio/video (AV) data transmission protection between devices connected in accordance with the Institute of Electrical and Electronics Engineers (IEEE) 1394 standard, and has been extended for protection of AV data transmitted by universal serial bus (USB), media oriented systems transport (MOST), Bluetooth, or Internet protocol (IP). The original purpose of the DTCP standard was to transmit compressed AV data. However, the DTCP standard can also be used for transmitting all types of data regardless of their content format. Algorithms used for encrypting data in accordance with the DTCP standard include M6 and a cipher block chaining (CBC) mode of the advanced encryption standard (AES) using a 128-bit key. The CBC mode of AES is a more stable algorithm.
Currently, demands for communication of non-compressed AV data through a wireless communication system having a transmission rate of several gigabits per second (Gbps) by using a tens of gigahertz (GHz) band have increased, and thus related technologies are being actively developed. The DTCP standard can also be applied to the above-described data communication technologies. In this case, the size of the transmission data is large, requiring a high-speed encryption algorithm.
FIG. 1 is a diagram illustrating a related art encryption algorithm in a CBC mode of the AES, showing encryption and decryption processes.
In the encryption process, data is divided into 128-bit data blocks P1 through Pn, and AES encryption is performed respectively on the data blocks P1 through Pn.
The data block P1 is added to an initial value (IV) and then encrypted using an encryption key Ek, to generate encrypted data C1. The data block P2 is added to the encrypted data C1 and the result is encrypted using the encryption key Ek to generate encrypted data C2 is generated. In the same manner, encrypted data C1 through Cn is generated using the data blocks P1 through Pn.
The decryption process is the inverse process of the encryption process.
In the decryption process, the encrypted data C1 is decrypted using a decryption key Dk and the result is added to an initial value IV to obtain the data block P1. The encrypted data C2 is decrypted using the decryption key Dk and the result is added to the encrypted data C1 to obtain the data block P2. In the same manner, the data blocks P1 through Pn are obtained.
As described above, the related art encryption algorithm using the CBC mode of the AES requires more time for encryption and decryption. Additionally, each encryption or decryption is affected by the previous encryption or decryption result.
To solve the above-mentioned problem, a counter mode of the AES can be used.
FIG. 2 is a diagram illustrating a related art encryption algorithm in a counter mode of the AES, showing encryption and decryption processes.
In the encryption process, data is divided into 128-bit data blocks P1 through Pm, a number of counters t1 through tm corresponding to the number of the data blocks P1 through Pm are generated, and AES encryption is performed on the data blocks P1 through Pm using the counters t1 through tm.
In this case, the counters t1 through tm are predetermined values regardless of the data blocks P1 through Pm. In general, counters t2 through tm are set by adding 1 to the previous counter. For example, a counter t2 is set by adding 1 to an initial counter t1, and a counter t3 is set by adding 1 to the counter t2.
The counters t1 through tm are encrypted using an encryption key Ek and then an exclusive OR operation is performed on the encrypted counters t1 through tm and the data blocks P1 through Pm, respectively. Thus, encrypted data C1 through Cm are generated.
The decryption process is the inverse process of the encryption process.
In the decryption process, the counter t1 is encrypted using the encryption key Ek and then an exclusive OR operation is performed on the encrypted counter t1 and the encrypted data C1. Thus, the original data block P1 is obtained. Data blocks P2 through Pn may be obtained in the same manner as the data block P1.
The encryption algorithm in the counter mode of the AES does not rely on a previous AES encryption result, enabling parallel encryption and decryption and increasing encryption speed.
However, the counter mode of the AES is not included in the DTCP standard, and has weaknesses. The counters in the counter mode of the AES can be predicted in advance, and a third party can recreate original data from encrypted data if a plurality of data blocks are encrypted using the same encryption key and the same counter.